home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIExceptionService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  12KB  |  303 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIExceptionService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIExceptionService_h__
  6. #define __gen_nsIExceptionService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIException_h__
  14. #include "nsIException.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21.  
  22. /* starting interface:    nsIExceptionProvider */
  23. #define NS_IEXCEPTIONPROVIDER_IID_STR "0577744c-c1d2-47f2-8bcc-ce7a9e5a88fc"
  24.  
  25. #define NS_IEXCEPTIONPROVIDER_IID \
  26.   {0x0577744c, 0xc1d2, 0x47f2, \
  27.     { 0x8b, 0xcc, 0xce, 0x7a, 0x9e, 0x5a, 0x88, 0xfc }}
  28.  
  29. class NS_NO_VTABLE nsIExceptionProvider : public nsISupports {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEXCEPTIONPROVIDER_IID)
  33.  
  34.   /** Gets an nsIException or returns NULL if not possible. **/
  35.   /* nsIException getException (in nsresult result, in nsIException defaultException); */
  36.   NS_IMETHOD GetException(nsresult result, nsIException *defaultException, nsIException **_retval) = 0;
  37.  
  38. };
  39.  
  40. /* Use this macro when declaring classes that implement this interface. */
  41. #define NS_DECL_NSIEXCEPTIONPROVIDER \
  42.   NS_IMETHOD GetException(nsresult result, nsIException *defaultException, nsIException **_retval); 
  43.  
  44. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  45. #define NS_FORWARD_NSIEXCEPTIONPROVIDER(_to) \
  46.   NS_IMETHOD GetException(nsresult result, nsIException *defaultException, nsIException **_retval) { return _to GetException(result, defaultException, _retval); } 
  47.  
  48. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  49. #define NS_FORWARD_SAFE_NSIEXCEPTIONPROVIDER(_to) \
  50.   NS_IMETHOD GetException(nsresult result, nsIException *defaultException, nsIException **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetException(result, defaultException, _retval); } 
  51.  
  52. #if 0
  53. /* Use the code below as a template for the implementation class for this interface. */
  54.  
  55. /* Header file */
  56. class nsExceptionProvider : public nsIExceptionProvider
  57. {
  58. public:
  59.   NS_DECL_ISUPPORTS
  60.   NS_DECL_NSIEXCEPTIONPROVIDER
  61.  
  62.   nsExceptionProvider();
  63.  
  64. private:
  65.   ~nsExceptionProvider();
  66.  
  67. protected:
  68.   /* additional members */
  69. };
  70.  
  71. /* Implementation file */
  72. NS_IMPL_ISUPPORTS1(nsExceptionProvider, nsIExceptionProvider)
  73.  
  74. nsExceptionProvider::nsExceptionProvider()
  75. {
  76.   /* member initializers and constructor code */
  77. }
  78.  
  79. nsExceptionProvider::~nsExceptionProvider()
  80. {
  81.   /* destructor code */
  82. }
  83.  
  84. /* nsIException getException (in nsresult result, in nsIException defaultException); */
  85. NS_IMETHODIMP nsExceptionProvider::GetException(nsresult result, nsIException *defaultException, nsIException **_retval)
  86. {
  87.     return NS_ERROR_NOT_IMPLEMENTED;
  88. }
  89.  
  90. /* End of implementation class template. */
  91. #endif
  92.  
  93.  
  94. /* starting interface:    nsIExceptionManager */
  95. #define NS_IEXCEPTIONMANAGER_IID_STR "efc9d00b-231c-4feb-852c-ac017266a415"
  96.  
  97. #define NS_IEXCEPTIONMANAGER_IID \
  98.   {0xefc9d00b, 0x231c, 0x4feb, \
  99.     { 0x85, 0x2c, 0xac, 0x01, 0x72, 0x66, 0xa4, 0x15 }}
  100.  
  101. class NS_NO_VTABLE nsIExceptionManager : public nsISupports {
  102.  public: 
  103.  
  104.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEXCEPTIONMANAGER_IID)
  105.  
  106.   /** Sets (or clears with nsnull) the current error on the this thread. */
  107.   /* void setCurrentException (in nsIException error); */
  108.   NS_IMETHOD SetCurrentException(nsIException *error) = 0;
  109.  
  110.   /** Gets the current error for the current thread, or NULL if no error */
  111.   /* nsIException getCurrentException (); */
  112.   NS_IMETHOD GetCurrentException(nsIException **_retval) = 0;
  113.  
  114.   /** Gets an exception from a registered exception provider..
  115.         This has no effect on the "current exception" */
  116.   /* nsIException getExceptionFromProvider (in nsresult rc, in nsIException defaultException); */
  117.   NS_IMETHOD GetExceptionFromProvider(nsresult rc, nsIException *defaultException, nsIException **_retval) = 0;
  118.  
  119. };
  120.  
  121. /* Use this macro when declaring classes that implement this interface. */
  122. #define NS_DECL_NSIEXCEPTIONMANAGER \
  123.   NS_IMETHOD SetCurrentException(nsIException *error); \
  124.   NS_IMETHOD GetCurrentException(nsIException **_retval); \
  125.   NS_IMETHOD GetExceptionFromProvider(nsresult rc, nsIException *defaultException, nsIException **_retval); 
  126.  
  127. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  128. #define NS_FORWARD_NSIEXCEPTIONMANAGER(_to) \
  129.   NS_IMETHOD SetCurrentException(nsIException *error) { return _to SetCurrentException(error); } \
  130.   NS_IMETHOD GetCurrentException(nsIException **_retval) { return _to GetCurrentException(_retval); } \
  131.   NS_IMETHOD GetExceptionFromProvider(nsresult rc, nsIException *defaultException, nsIException **_retval) { return _to GetExceptionFromProvider(rc, defaultException, _retval); } 
  132.  
  133. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  134. #define NS_FORWARD_SAFE_NSIEXCEPTIONMANAGER(_to) \
  135.   NS_IMETHOD SetCurrentException(nsIException *error) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCurrentException(error); } \
  136.   NS_IMETHOD GetCurrentException(nsIException **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentException(_retval); } \
  137.   NS_IMETHOD GetExceptionFromProvider(nsresult rc, nsIException *defaultException, nsIException **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExceptionFromProvider(rc, defaultException, _retval); } 
  138.  
  139. #if 0
  140. /* Use the code below as a template for the implementation class for this interface. */
  141.  
  142. /* Header file */
  143. class nsExceptionManager : public nsIExceptionManager
  144. {
  145. public:
  146.   NS_DECL_ISUPPORTS
  147.   NS_DECL_NSIEXCEPTIONMANAGER
  148.  
  149.   nsExceptionManager();
  150.  
  151. private:
  152.   ~nsExceptionManager();
  153.  
  154. protected:
  155.   /* additional members */
  156. };
  157.  
  158. /* Implementation file */
  159. NS_IMPL_ISUPPORTS1(nsExceptionManager, nsIExceptionManager)
  160.  
  161. nsExceptionManager::nsExceptionManager()
  162. {
  163.   /* member initializers and constructor code */
  164. }
  165.  
  166. nsExceptionManager::~nsExceptionManager()
  167. {
  168.   /* destructor code */
  169. }
  170.  
  171. /* void setCurrentException (in nsIException error); */
  172. NS_IMETHODIMP nsExceptionManager::SetCurrentException(nsIException *error)
  173. {
  174.     return NS_ERROR_NOT_IMPLEMENTED;
  175. }
  176.  
  177. /* nsIException getCurrentException (); */
  178. NS_IMETHODIMP nsExceptionManager::GetCurrentException(nsIException **_retval)
  179. {
  180.     return NS_ERROR_NOT_IMPLEMENTED;
  181. }
  182.  
  183. /* nsIException getExceptionFromProvider (in nsresult rc, in nsIException defaultException); */
  184. NS_IMETHODIMP nsExceptionManager::GetExceptionFromProvider(nsresult rc, nsIException *defaultException, nsIException **_retval)
  185. {
  186.     return NS_ERROR_NOT_IMPLEMENTED;
  187. }
  188.  
  189. /* End of implementation class template. */
  190. #endif
  191.  
  192.  
  193. /* starting interface:    nsIExceptionService */
  194. #define NS_IEXCEPTIONSERVICE_IID_STR "35a88f54-f267-4414-92a7-191f6454ab52"
  195.  
  196. #define NS_IEXCEPTIONSERVICE_IID \
  197.   {0x35a88f54, 0xf267, 0x4414, \
  198.     { 0x92, 0xa7, 0x19, 0x1f, 0x64, 0x54, 0xab, 0x52 }}
  199.  
  200. class NS_NO_VTABLE nsIExceptionService : public nsIExceptionManager {
  201.  public: 
  202.  
  203.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEXCEPTIONSERVICE_IID)
  204.  
  205.   /** Obtains an exception manager for the current thread. */
  206.   /* readonly attribute nsIExceptionManager currentExceptionManager; */
  207.   NS_IMETHOD GetCurrentExceptionManager(nsIExceptionManager * *aCurrentExceptionManager) = 0;
  208.  
  209.   /** Installs an "exception provider" which is capable of
  210.         translating an nsresult into an exception.  This enables
  211.         error providers to return simple nsresults and only provide
  212.         rich errors when specifically requested. It also has the
  213.         advantage of allowing code like the DOM to handle all errors
  214.         in a single function rather than at each XPCOM entry point.
  215.         NOTE: This interface must be thread-safe - it will be called
  216.         on whatever thread needs the error translation performed.*/
  217.   /* void registerExceptionProvider (in nsIExceptionProvider provider, in PRUint32 moduleCode); */
  218.   NS_IMETHOD RegisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) = 0;
  219.  
  220.   /* void unregisterExceptionProvider (in nsIExceptionProvider provider, in PRUint32 moduleCode); */
  221.   NS_IMETHOD UnregisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) = 0;
  222.  
  223. };
  224.  
  225. /* Use this macro when declaring classes that implement this interface. */
  226. #define NS_DECL_NSIEXCEPTIONSERVICE \
  227.   NS_IMETHOD GetCurrentExceptionManager(nsIExceptionManager * *aCurrentExceptionManager); \
  228.   NS_IMETHOD RegisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode); \
  229.   NS_IMETHOD UnregisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode); 
  230.  
  231. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  232. #define NS_FORWARD_NSIEXCEPTIONSERVICE(_to) \
  233.   NS_IMETHOD GetCurrentExceptionManager(nsIExceptionManager * *aCurrentExceptionManager) { return _to GetCurrentExceptionManager(aCurrentExceptionManager); } \
  234.   NS_IMETHOD RegisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) { return _to RegisterExceptionProvider(provider, moduleCode); } \
  235.   NS_IMETHOD UnregisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) { return _to UnregisterExceptionProvider(provider, moduleCode); } 
  236.  
  237. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  238. #define NS_FORWARD_SAFE_NSIEXCEPTIONSERVICE(_to) \
  239.   NS_IMETHOD GetCurrentExceptionManager(nsIExceptionManager * *aCurrentExceptionManager) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentExceptionManager(aCurrentExceptionManager); } \
  240.   NS_IMETHOD RegisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterExceptionProvider(provider, moduleCode); } \
  241.   NS_IMETHOD UnregisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterExceptionProvider(provider, moduleCode); } 
  242.  
  243. #if 0
  244. /* Use the code below as a template for the implementation class for this interface. */
  245.  
  246. /* Header file */
  247. class nsExceptionService : public nsIExceptionService
  248. {
  249. public:
  250.   NS_DECL_ISUPPORTS
  251.   NS_DECL_NSIEXCEPTIONSERVICE
  252.  
  253.   nsExceptionService();
  254.  
  255. private:
  256.   ~nsExceptionService();
  257.  
  258. protected:
  259.   /* additional members */
  260. };
  261.  
  262. /* Implementation file */
  263. NS_IMPL_ISUPPORTS1(nsExceptionService, nsIExceptionService)
  264.  
  265. nsExceptionService::nsExceptionService()
  266. {
  267.   /* member initializers and constructor code */
  268. }
  269.  
  270. nsExceptionService::~nsExceptionService()
  271. {
  272.   /* destructor code */
  273. }
  274.  
  275. /* readonly attribute nsIExceptionManager currentExceptionManager; */
  276. NS_IMETHODIMP nsExceptionService::GetCurrentExceptionManager(nsIExceptionManager * *aCurrentExceptionManager)
  277. {
  278.     return NS_ERROR_NOT_IMPLEMENTED;
  279. }
  280.  
  281. /* void registerExceptionProvider (in nsIExceptionProvider provider, in PRUint32 moduleCode); */
  282. NS_IMETHODIMP nsExceptionService::RegisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode)
  283. {
  284.     return NS_ERROR_NOT_IMPLEMENTED;
  285. }
  286.  
  287. /* void unregisterExceptionProvider (in nsIExceptionProvider provider, in PRUint32 moduleCode); */
  288. NS_IMETHODIMP nsExceptionService::UnregisterExceptionProvider(nsIExceptionProvider *provider, PRUint32 moduleCode)
  289. {
  290.     return NS_ERROR_NOT_IMPLEMENTED;
  291. }
  292.  
  293. /* End of implementation class template. */
  294. #endif
  295.  
  296. #define NS_EXCEPTIONSERVICE_CLASSNAME "Exception Service"
  297. // {35A88F54-F267-4414-92A7-191F6454AB52}
  298. #define NS_EXCEPTIONSERVICE_CID \
  299. { 0x35a88f54, 0xf267, 0x4414, { 0x92, 0xa7, 0x19, 0x1f, 0x64, 0x54, 0xab, 0x52 } }
  300. #define NS_EXCEPTIONSERVICE_CONTRACTID "@mozilla.org/exceptionservice;1"
  301.  
  302. #endif /* __gen_nsIExceptionService_h__ */
  303.